using System.Data.Entity.ModelConfiguration;
using EmployeesManager.Poco;

namespace Employeesmanager.DataAccessEF
{
    public class EmployeeConfig : EntityTypeConfiguration<Employee>
    {
        public EmployeeConfig()
        {
            HasOptional(x => x.Manager).WithMany().HasForeignKey(x=>x.ManagerId); ;
            Property(x => x.Name).IsRequired();
            Property(x => x.Salary).IsRequired();
        }
    }
}